package com.prs.crm.action.oa;

import java.io.File;
import java.util.Collection;
import java.util.Date;
import java.util.Iterator;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.courser.struts.BaseAction;
import org.courser.ui.PaginationSupport;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;

import com.prs.crm.context.AppContext;
import com.prs.crm.context.FileUtil;
import com.prs.crm.context.ToolKits;
import com.prs.crm.domain.Attachment;
import com.prs.crm.domain.hr.Person;
import com.prs.crm.domain.oa.Announcement;
import com.prs.crm.domain.oa.AnnouncementCollect;
import com.prs.crm.domain.oa.AnnouncementCollectType;
import com.prs.crm.domain.oa.AnnouncementReceive;
import com.prs.crm.domain.oa.Comment;
import com.prs.crm.domain.oa.CommentChild;
import com.prs.crm.domain.oa.NewsCollect;
import com.prs.crm.domain.oa.NewsCollectType;
import com.prs.crm.domain.oa.NewsReceive;
import com.prs.crm.service.AttachmentService;
import com.prs.crm.service.hr.PersonService;
import com.prs.crm.service.oa.AnnouncementCollectService;
import com.prs.crm.service.oa.AnnouncementCollectTypeService;
import com.prs.crm.service.oa.AnnouncementReceiveService;
import com.prs.crm.service.oa.AnnouncementService;
import com.prs.crm.service.oa.CommentChildService;
import com.prs.crm.service.oa.CommentService;

public class AnnouncementAction extends BaseAction{
	private static final long serialVersionUID = 1L;
	private PaginationSupport pagination;
	private Announcement announcement;
	private AnnouncementService announcementService;
	private PersonService personService;
	private String accepts;  //接收人id
	private File upload;
	private String uploadFileName;
	private AnnouncementReceive announcementReceive;
	private AnnouncementReceiveService announcementReceiveService;
	private Integer[] announcementIds;
	private AnnouncementCollectType announcementCollectType;
	private AnnouncementCollectTypeService announcementCollectTypeService;
	private AnnouncementCollect announcementCollect;
	private AnnouncementCollectService announcementCollectService;
	private Integer[] receiveIds;
	private String type;
	private AttachmentService attachmentService;
	private CommentService commentService;
	private CommentChildService commentChildService;
	@Action("listAnnouncement")
	public String listAnnouncement() {
		DetachedCriteria criteria = this.getPaginationHelper().createQuery(
				Announcement.class);
		criteria.add(Restrictions.eq("oabox", 1));
		criteria.add(Restrictions.eq("recorder.id", AppContext.getAccountContext().currentUser().getId()));
		pagination = this.getPaginationHelper().prepare(pagination);
		this.setPagination(this.announcementService.listByPage(criteria,
				pagination));
		return SUCCESS;
	}
	@Action("listAnnouncementDarft")
	public String listAnnouncementDarft() {
		DetachedCriteria criteria = this.getPaginationHelper().createQuery(
				Announcement.class);
		criteria.add(Restrictions.eq("oabox", 0));
		pagination = this.getPaginationHelper().prepare(pagination);
		this.setPagination(this.announcementService.listByPage(criteria,
				pagination));
		return SUCCESS;
	}
	@Action("listAnnouncementReceive")
	public String listAnnouncementReceive() {
		DetachedCriteria criteria = this.getPaginationHelper().createQuery(
				AnnouncementReceive.class);
		criteria.add(Restrictions.eq("oabox", 1));
		criteria.add(Restrictions.eq("receivePerson.id", AppContext.getAccountContext().currentUser().getId()));
		pagination = this.getPaginationHelper().prepare(pagination);
		this.setPagination(this.announcementService.listByPage(criteria,
				pagination));
		return SUCCESS;
	}
	@Action("editAnnouncement")
	public String editAnnouncement() {
		if(this.announcementIds!=null){
			this.announcement=this.announcementService.get(announcementIds[0]);
		}
		return SUCCESS;
	}
	@Action("viewAnnouncement")
	public String viewAnnouncement() {
		
		return SUCCESS;
	}
	@Action("viewAnnouncementReceive")
	public String viewAnnouncementReceive() {
		if(this.receiveIds!=null){
			this.announcementReceive=this.announcementReceiveService.get(receiveIds[0]);
		}
		if(announcementReceive.getState().equals("未读")){
			announcementReceive.setState("已读");
			this.announcementReceiveService.submit(announcementReceive);
		}
		return SUCCESS;
	}
	@Action("forWardAnnouncement")
	public String forWardAnnouncement() {
		if(this.announcementIds!=null){
			this.announcement=this.announcementService.get(announcementIds[0]);
		}
		
		announcement.setContent("<BR><BR>----- Original Message ----- <BR>" +
						"From: "+announcement.getRecorder().getResume().getName()+"<BR>" +
						"To："+announcement.getReceive()+"<BR>" +
						"Title："+announcement.getTitle()+"<BR>" +
						"Content: <BR>"+announcement.getContent());
		announcement.setReceive("");
		announcement.setTitle("Fw: "+announcement.getTitle());
		return SUCCESS;
	}
	@Action("forWardAnnouncementReceive")
	public String forWardAnnouncementReceive() {
		if (announcement!=null) {
			announcement.setContent("<BR><BR>----- Original Message ----- <BR>" +
							"From: "+announcement.getRecorder().getResume().getName()+"<BR>" +
							"To："+announcement.getReceive()+"<BR>" +
							"Title："+announcement.getTitle()+"<BR>" +
							"Content: <BR>"+announcement.getContent());
			announcement.setReceive("");
			announcement.setTitle("Fw: "+announcement.getTitle());
		}
		if (announcementReceive!=null) {
			announcement=new Announcement();
			announcement.setContent("<BR><BR>----- Original Message ----- <BR>" +
					"From: "+announcementReceive.getRecorder().getResume().getName()+"<BR>" +
					"To："+announcementReceive.getReceivePerson().getResume().getName()+"<BR>" +
					"Title："+announcementReceive.getTitle()+"<BR>" +
					"Content: <BR>"+announcementReceive.getContent());
			announcement.setReceive("");
			announcement.setTitle("Fw: "+announcementReceive.getTitle());
		}
		if(this.announcementIds!=null){
			this.announcement=this.announcementService.get(announcementIds[0]);
			announcement.setContent("<BR><BR>----- Original Message ----- <BR>" +
							"From: "+announcement.getRecorder().getResume().getName()+"<BR>" +
							"To："+announcement.getReceive()+"<BR>" +
							"Title："+announcement.getTitle()+"<BR>" +
							"Content: <BR>"+announcement.getContent());
			announcement.setReceive("");
			announcement.setTitle("Fw: "+announcement.getTitle());
		}
		if (receiveIds!=null) {
			announcementReceive=this.getAnnouncementReceiveService().get(receiveIds[0]);
			announcement=new Announcement();
			announcement.setContent("<BR><BR>----- Original Message ----- <BR>" +
					"From: "+announcementReceive.getRecorder().getResume().getName()+"<BR>" +
					"To："+announcementReceive.getReceivePerson().getResume().getName()+"<BR>" +
					"Title："+announcementReceive.getTitle()+"<BR>" +
					"Content: <BR>"+announcementReceive.getContent());
			announcement.setReceive("");
			announcement.setTitle("Fw: "+announcementReceive.getTitle());
		}
		return SUCCESS;
	}
	@Action(value = "saveAnnouncementCollect", results = {
			@Result(name = "success", type = "redirect", location = "listAnnouncement"),
			@Result(name = "error", type = "chain", location = "viewAnnouncement?announcement=${announcement.getId()}") })
	public String saveNewsCollect() {
			AnnouncementCollect collect=new AnnouncementCollect();
			collect.setAnnouncement(announcement);
			announcementCollectType=this.announcementCollectTypeService.getTypeByName("已发公告");
			if(announcementCollectType==null){
				announcementCollectType=new AnnouncementCollectType();
				announcementCollectType.setName("已发公告");
				this.announcementCollectTypeService.save(announcementCollectType);
			}
			collect.setType(announcementCollectType);
			this.announcementCollectService.save(collect);
			announcement.setOabox(3);  //3表示已收藏
			this.announcementService.submit(announcement);
		return SUCCESS;
	}
	@Action(value = "saveAnnouncementReceiveCollect", results = {
			@Result(name = "success", type = "redirect", location = "listAnnouncementReceive"),
			@Result(name = "error", type = "chain", location = "viewAnnouncementReceive?announcementReceive=${announcementReceive.getId()}") })
	public String saveAnnouncementReceiveCollect() {
			AnnouncementCollect collect=new AnnouncementCollect();
			announcementReceive.setOabox(3);
			collect.setAnnouncementReceive(announcementReceive);
			this.announcementCollectType=this.announcementCollectTypeService.getTypeByName("已收公告");
			if(announcementCollectType==null){
				announcementCollectType=new AnnouncementCollectType();
				announcementCollectType.setName("已收公告");
				this.announcementCollectTypeService.save(announcementCollectType);
			}
			collect.setType(announcementCollectType);
			this.announcementCollectService.save(collect);
			announcementReceive.setOabox(0);  //0表示已收藏
			this.announcementReceiveService.submit(announcementReceive);
		return SUCCESS;
	}
	@Action(value = "sendAnnouncement", results = {
			@Result(name = "success", type = "redirect", location = "editAnnouncement"),
			@Result(name = "error", type = "chain", location = "editAnnouncement") })
	public String sendAnnouncement() {
		//已发新闻设置
		announcement.setOabox(1);//0表示草稿
		announcement.setTop(0);
		announcement.setCreatTime(new Date());
		if(upload!=null){
			Attachment attach=FileUtil.getInstance().createAttach(upload, uploadFileName);
			this.getAttachmentService().save(attach);
			announcement.setAttach(attach);
		}
		if (announcement.getId()==null) {
			announcement.setAccepts(accepts);
		}
		
		this.announcementService.save(announcement);
		//已收新闻设置
		Collection<Person> acceptPersons = this.getPersonService().findPersons(ToolKits.convertStringAryToIntAry(announcement.getAccepts().split(",")));
		Iterator<Person> iter = acceptPersons.iterator();
		while(iter.hasNext()) {
			Person person = iter.next();
			AnnouncementReceive re=new AnnouncementReceive();
			re.setOabox(1);
			re.setAnnouncementId(announcement.getId());
			re.setTitle(announcement.getTitle());
			re.setContent(announcement.getContent());
			re.setIsComment(announcement.getIsComment());
			re.setDegree(announcement.getDegree());
			if (announcement.getAttach()!=null) {
				re.setAttach(announcement.getAttach());
			}
			re.setSendPerson(AppContext.getAccountContext().currentUser()); //发送人
			re.setReceivePerson(person);  //接收人
			re.setState("未读");
			this.announcementReceiveService.save(re);
		}
		this.setPrompt("公告发送成功");
		return SUCCESS;
	}
	@Action(value = "sendAnnouncementDraft", results = {
			@Result(name = "success", type = "redirect", location = "listAnnouncementDarft"),
			@Result(name = "error", type = "chain", location = "listAnnouncementDarft") })
	public String sendAnnouncementDraft() {
		//已发新闻设置
		announcement=this.announcementService.get(announcementIds[0]);
		
		//已收新闻设置
		announcement.setOabox(1);//0表示草稿
		announcement.setTop(0);
		announcement.setCreatTime(new Date());
		Collection<Person> acceptPersons = this.getPersonService().findPersons(ToolKits.convertStringAryToIntAry(announcement.getAccepts().split(",")));
		Iterator<Person> iter = acceptPersons.iterator();
		while(iter.hasNext()) {
			Person person = iter.next();
			AnnouncementReceive re=new AnnouncementReceive();
			re.setAnnouncementId(announcement.getId());
			re.setTitle(announcement.getTitle());
			re.setContent(announcement.getContent());
			re.setIsComment(announcement.getIsComment());
			re.setDegree(announcement.getDegree());
			if (announcement.getAttach()!=null) {
				re.setAttach(announcement.getAttach());
			}
			re.setSendPerson(AppContext.getAccountContext().currentUser()); //发送人
			re.setReceivePerson(person);  //接收人
			re.setOabox(1);
			re.setState("未读");
			this.announcementReceiveService.save(re);
		}
		this.announcementService.submit(announcement);
		this.setPrompt("公告发送成功");
		return SUCCESS;
	}
	@Action(value = "sendforWardAnnouncement", results = {
			@Result(name = "success", type = "redirect", location = "listAnnouncement"),
			@Result(name = "error", type = "chain", location = "forWardAnnouncement") })
	public String sendforWardAnnouncement() {
		//已发新闻设置
		announcement.setOabox(1);//0表示草稿
		announcement.setCreatTime(new Date());
		if(upload!=null){
			Attachment attach=FileUtil.getInstance().createAttach(upload, uploadFileName);
			this.getAttachmentService().save(attach);
			announcement.setAttach(attach);
		}
		announcement.setAccepts(accepts);
		this.announcementService.save(announcement);
		//已收新闻设置
		Collection<Person> acceptPersons = this.getPersonService().findPersons(ToolKits.convertStringAryToIntAry(accepts.split(",")));
		Iterator<Person> iter = acceptPersons.iterator();
		while(iter.hasNext()) {
			Person person = iter.next();
			AnnouncementReceive re=new AnnouncementReceive();
			re.setAnnouncementId(announcement.getId());
			re.setTitle(announcement.getTitle());
			re.setContent(announcement.getContent());
			re.setIsComment(announcement.getIsComment());
			re.setDegree(announcement.getDegree());
			if (announcement.getAttach()!=null) {
				re.setAttach(announcement.getAttach());
			}
			re.setSendPerson(AppContext.getAccountContext().currentUser()); //发送人
			re.setReceivePerson(person);  //接收人
			re.setOabox(1);
			re.setState("未读");
			this.announcementReceiveService.save(re);
		}
		this.setPrompt("公告发送成功");
		return SUCCESS;
	}
	@Action(value = "sendReplyAnnouncement", results = {
			@Result(name = "success", type = "redirect", location = "listAnnouncementReceive"),
			@Result(name = "error", type = "chain", location = "ReplyAnnouncement?announcement=${announcement.getId()}") })
	public String sendReplyAnnouncement() {
		//已发新闻设置
		announcement.setOabox(1);//0表示草稿
		announcement.setCreatTime(new Date());
		if(upload!=null){
			Attachment attach=FileUtil.getInstance().createAttach(upload, uploadFileName);
			this.getAttachmentService().save(attach);
			announcement.setAttach(attach);
		}
		announcement.setAccepts(accepts);
		this.announcementService.save(announcement);
		//已收新闻设置
		Collection<Person> acceptPersons = this.getPersonService().findPersons(ToolKits.convertStringAryToIntAry(accepts.split(",")));
		Iterator<Person> iter = acceptPersons.iterator();
		while(iter.hasNext()) {
			Person person = iter.next();
			AnnouncementReceive re=new AnnouncementReceive();
			re.setAnnouncementId(announcement.getId());
			re.setTitle(announcement.getTitle());
			re.setContent(announcement.getContent());
			re.setIsComment(announcement.getIsComment());
			re.setDegree(announcement.getDegree());
			if (announcement.getAttach()!=null) {
				re.setAttach(announcement.getAttach());
			}
			re.setSendPerson(AppContext.getAccountContext().currentUser()); //发送人
			re.setReceivePerson(person);  //接收人
			re.setOabox(1);
			re.setState("未读");
			this.announcementReceiveService.save(re);
		}
		this.setPrompt("公告发送成功");
		return SUCCESS;
	}
	@Action(value = "saveAnnouncementDraft", results = {
			@Result(name = "success", type = "redirect", location = "editAnnouncement"),
			@Result(name = "error", type = "chain", location = "editAnnouncement") })
	public String saveAnnouncementDraft() {
		//已发新闻设置
		announcement.setAccepts(accepts);
		announcement.setOabox(0);//0表示草稿
		announcement.setCreatTime(new Date());
		if(upload!=null){
			Attachment attach=FileUtil.getInstance().createAttach(upload, uploadFileName);
			this.getAttachmentService().save(attach);
			announcement.setAttach(attach);
		}
		announcement.setAccepts(accepts);
		this.announcementService.save(announcement);
		return SUCCESS;
	}
	@Action(value = "removeAnnouncement", results = {
			@Result(name = "success", type = "redirect", location = "listAnnouncement"),
			@Result(name = "error", type = "chain", location = "listAnnouncement") })
	public String removeAnnouncement() {
		for(Integer id:announcementIds){
			this.announcement=this.announcementService.get(id);
			if(announcement.getCollects().size()!=0){
				this.addActionError("公告收藏,不能删除");
				return ERROR;
			}
			for (int i = 0; i < announcement.getComment().size(); i++) {
				Comment c=announcement.getComment().get(i);
				for (int j = 0; j < c.getChilds().size(); j++) {
					CommentChild cc=c.getChilds().get(j);
					System.out.println(cc.getContent());
					this.getCommentChildService().remove(cc);
				}
				this.getCommentService().remove(c);
			}
		}
		this.announcementService.batchRemove(announcementIds);
		return SUCCESS;
	}
	@Action(value = "deleteAnnouncement", results = {
			@Result(name = "success", type = "redirect", location = "listAnnouncement"),
			@Result(name = "error", type = "chain", location = "viewAnnouncement?announcement=${announcement.getId()}") })
	public String deleteAnnouncement() {
//			if(announcement.getRecevies().size()!=0){
//				this.addActionError("公告已发,不能删除");
//				return ERROR;
//			}else 
		if(announcement.getCollects().size()!=0){
				this.addActionError("公告收藏,不能删除");
				return ERROR;
			}
		for (int i = 0; i < announcement.getComment().size(); i++) {
			Comment c=announcement.getComment().get(i);
			for (int j = 0; j < c.getChilds().size(); j++) {
				CommentChild cc=c.getChilds().get(j);
				System.out.println(cc.getContent());
				this.getCommentChildService().remove(cc);
			}
			this.getCommentService().remove(c);
		}
		this.announcementService.remove(this.announcement);
		this.setPrompt("删除成功");
		return SUCCESS;
	}
	@Action(value = "removeAnnouncementReceive", results = {
			@Result(name = "success", type = "redirect", location = "listAnnouncementReceive"),
			@Result(name = "error", type = "chain", location = "listAnnouncementReceive") })
	public String removeAnnouncementReceive() {
		for (Integer id : receiveIds) {
			this.announcementReceive=this.getAnnouncementReceiveService().get(id);
			for (int i = 0; i < announcementReceive.getComment().size(); i++) {
				Comment c=announcementReceive.getComment().get(i);
				for (int j = 0; j < c.getChilds().size(); j++) {
					CommentChild cc=c.getChilds().get(j);
					this.getCommentChildService().remove(cc);
				}
				this.getCommentService().remove(c);
			}
		}
		
		this.announcementReceiveService.batchRemove(receiveIds);
		return SUCCESS;
	}
	@Action("ReplyAnnouncement")
	public String ReplyAnnouncement() {
		if(receiveIds!=null){
			this.announcementReceive=this.announcementReceiveService.get(receiveIds[0]);
//			this.announcement=announcementReceive.getAnnouncement();
		}
		Announcement ac=this.getAnnouncementService().getAnnouncementId(announcementReceive.getAnnouncementId());
		if (ac!=null) {
			if(type.equals("1")){  //回复全部
				announcement=new Announcement();
				announcement.setReceive(ac.getReceive());
				announcement.setContent("<BR><BR>----- Original Message ----- <BR>" +
								"From: "+ac.getRecorder().getResume().getName()+"<BR>" +
								"To："+ac.getReceive()+"<BR>" +
								"Title："+ac.getTitle()+"<BR>" +
								"Content: <BR>"+ac.getContent());
				this.accepts=ac.getAccepts();
				announcement.setTitle("Re: "+ac.getTitle());
			}else{
				announcement=new Announcement();
				announcement.setReceive(ac.getReceive());
				String[] receive=ac.getReceive().split(",");
				String[] acc=ac.getAccepts().split(",");
				announcement.setContent("<BR><BR>----- Original Message ----- <BR>" +
						"From: "+ac.getRecorder().getResume().getName()+"<BR>" +
						"To："+receive[0]+"<BR>" +
						"Title："+ac.getTitle()+"<BR>" +
						"Content: <BR>"+ac.getContent());
				this.accepts=acc[0];
				announcement.setTitle("Re: "+ac.getTitle());
			}
		}
		
		return SUCCESS;
	}
	@Action(value = "saveAccouncementDraft", results = {
			@Result(name = "success", type = "redirect", location = "listAnnouncementReceive"),
			@Result(name = "error", type = "chain", location = "listAnnouncementReceive") })
	public String saveAccouncementDraft() {
		this.announcement.setOabox(0);
		this.announcementService.submit(announcement);
		this.setPrompt("保存公告到草稿箱成功");
		return SUCCESS;
	}
	@Action(value = "deleteAnnouncementReceive", results = {
			@Result(name = "success", type = "redirect", location = "listAnnouncementReceive"),
			@Result(name = "error", type = "chain", location = "viewAnnouncementReceive?announcementReceive=${announcementReceive.getId()}") })
	public String deleteAnnouncementReceive() {
		for (int i = 0; i < announcementReceive.getComment().size(); i++) {
			Comment c=announcementReceive.getComment().get(i);
			for (int j = 0; j < c.getChilds().size(); j++) {
				CommentChild cc=c.getChilds().get(j);
				this.getCommentChildService().remove(cc);
			}
			this.getCommentService().remove(c);
		}
		this.announcementReceiveService.remove(announcementReceive);
		return SUCCESS;
	}
	@Action(value = "removeAnnouncementDraft", results = {
			@Result(name = "success", type = "redirect", location = "listAnnouncementDarft"),
			@Result(name = "error", type = "chain", location = "listAnnouncementDarft") })
	public String removeAnnouncementDraft() {
		this.announcementService.batchRemove(announcementIds);
		return SUCCESS;
	}
	
	@Action("listAnnouncements")
	public String listAnnouncements() {
		DetachedCriteria criteria = this.getPaginationHelper().createQuery(
				Announcement.class);
		criteria.add(Restrictions.eq("oabox", 1));
		criteria.addOrder(Order.desc("top"));
		pagination = this.getPaginationHelper().prepare(pagination);
		this.setPagination(this.announcementService.listByPage(criteria,
				pagination));
		return SUCCESS;
	}
	
	@Action(value = "saveAnnouncementTop", results = {
			@Result(name = "success", type = "redirect", location = "listAnnouncements"),
			@Result(name = "error", type = "chain", location = "listAnnouncements") })
	public String saveAnnouncementTop(){
		if (announcementIds!=null) {
			this.announcement=this.getAnnouncementService().get(announcementIds[0]);
		}
		announcement.setTop(1);
		this.getAnnouncementService().save(announcement);
		return SUCCESS;
	}
	@Action(value = "saveNotTop", results = {
			@Result(name = "success", type = "redirect", location = "listAnnouncements"),
			@Result(name = "error", type = "chain", location = "listAnnouncements") })
	public String saveNotTop(){
		if (announcementIds!=null) {
			this.announcement=this.getAnnouncementService().get(announcementIds[0]);
		}
		announcement.setTop(0);
		this.getAnnouncementService().save(announcement);
		return SUCCESS;
	}
	
	@Action(value = "removeAnnouncements", results = {
			@Result(name = "success", type = "redirect", location = "listAnnouncements"),
			@Result(name = "error", type = "chain", location = "listAnnouncements") })
	public String removeAnnouncements() {
		for(Integer id:announcementIds){
			this.announcement=this.announcementService.get(id);
//			if(announcement.getRecevies().size()!=0){
//				this.addActionError("公告已发,不能删除");
//				return ERROR;
//			}else 
			if(announcement.getCollects().size()!=0){
				this.addActionError("公告收藏,不能删除");
				return ERROR;
			}
		}
		this.announcementService.batchRemove(announcementIds);
		return SUCCESS;
	}
	@Action("viewAnnouncements")
	public String viewAnnouncements() {
		
		return SUCCESS;
	}

	public PaginationSupport getPagination() {
		return pagination;
	}
	public void setPagination(PaginationSupport pagination) {
		this.pagination = pagination;
	}
	public Announcement getAnnouncement() {
		return announcement;
	}
	public void setAnnouncement(Announcement announcement) {
		this.announcement = announcement;
	}
	public AnnouncementService getAnnouncementService() {
		return announcementService;
	}
	public void setAnnouncementService(AnnouncementService announcementService) {
		this.announcementService = announcementService;
	}
	public PersonService getPersonService() {
		return personService;
	}
	public void setPersonService(PersonService personService) {
		this.personService = personService;
	}
	public String getAccepts() {
		return accepts;
	}
	public void setAccepts(String accepts) {
		this.accepts = accepts;
	}
	public File getUpload() {
		return upload;
	}
	public void setUpload(File upload) {
		this.upload = upload;
	}
	public String getUploadFileName() {
		return uploadFileName;
	}
	public void setUploadFileName(String uploadFileName) {
		this.uploadFileName = uploadFileName;
	}
	public AnnouncementReceive getAnnouncementReceive() {
		return announcementReceive;
	}
	public void setAnnouncementReceive(AnnouncementReceive announcementReceive) {
		this.announcementReceive = announcementReceive;
	}
	public AnnouncementReceiveService getAnnouncementReceiveService() {
		return announcementReceiveService;
	}
	public void setAnnouncementReceiveService(
			AnnouncementReceiveService announcementReceiveService) {
		this.announcementReceiveService = announcementReceiveService;
	}
	public Integer[] getAnnouncementIds() {
		return announcementIds;
	}
	public void setAnnouncementIds(Integer[] announcementIds) {
		this.announcementIds = announcementIds;
	}
	public AnnouncementCollectType getAnnouncementCollectType() {
		return announcementCollectType;
	}
	public void setAnnouncementCollectType(
			AnnouncementCollectType announcementCollectType) {
		this.announcementCollectType = announcementCollectType;
	}
	public AnnouncementCollectTypeService getAnnouncementCollectTypeService() {
		return announcementCollectTypeService;
	}
	public void setAnnouncementCollectTypeService(
			AnnouncementCollectTypeService announcementCollectTypeService) {
		this.announcementCollectTypeService = announcementCollectTypeService;
	}
	public AnnouncementCollect getAnnouncementCollect() {
		return announcementCollect;
	}
	public void setAnnouncementCollect(AnnouncementCollect announcementCollect) {
		this.announcementCollect = announcementCollect;
	}
	public AnnouncementCollectService getAnnouncementCollectService() {
		return announcementCollectService;
	}
	public void setAnnouncementCollectService(
			AnnouncementCollectService announcementCollectService) {
		this.announcementCollectService = announcementCollectService;
	}
	public Integer[] getReceiveIds() {
		return receiveIds;
	}
	public void setReceiveIds(Integer[] receiveIds) {
		this.receiveIds = receiveIds;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public AttachmentService getAttachmentService() {
		return attachmentService;
	}
	public void setAttachmentService(AttachmentService attachmentService) {
		this.attachmentService = attachmentService;
	}
	public CommentService getCommentService() {
		return commentService;
	}
	public void setCommentService(CommentService commentService) {
		this.commentService = commentService;
	}
	public CommentChildService getCommentChildService() {
		return commentChildService;
	}
	public void setCommentChildService(CommentChildService commentChildService) {
		this.commentChildService = commentChildService;
	}
	
}
